package scoutobahn.xml;

import java.util.Collection;
import java.util.LinkedList;
import java.util.Map;
/**
 * An OsmWay. A way is a collection of nodes.
 * @author mark
 *
 */
public class OsmWay extends OsmItem {

    private final Collection<OsmItem> nodes;
    /**
     * Constructs a new OsmWay with the given id and the given nodes.
     * @param newId The id
     * @param tags The tags
     * @param wayNodes The nodes
     */
    public OsmWay(final long newId,
            final Map<String, String> tags,
            final Collection<? extends OsmItem> wayNodes) {
        super(newId, tags);
        this.nodes = new LinkedList<OsmItem>(wayNodes);
    }
    /**
     * Returns all nodes of this way.
     * @return All nodes
     */
    public Collection<OsmItem> getNodes() {
        return this.nodes;
    }

}
